@charset "utf-8";

@import '../variable';

/**
 * 
 * @Radio.css
 * @author xinxuzhang 
 * @create 15-06-17
**/

input[type=radio] {
	position: absolute;
	clip: rect(0,0,0,0); /* IE8+ */
	*left: -999px;
}

.ui-radio {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 1px solid rgba($borderNormal, .99);  /* IE7-IE8 ignore this */
	border-radius: 50%;
	background-color: $white;
	box-sizing: border-box;
	vertical-align: -.5ex;
	*vertical-align: 0;
	-webkit-user-select: none;
	-ms-user-select: none;
	user-select: none;
	-webkit-transition: border-color .2s;
    transition: border-color .2s;
	overflow: hidden;
}

:not(:disabled) + .ui-radio:hover {
	border-color: $borderHover;
}

.ui-radio::before {
	content: '';
	display: block;
	width: 10px;
	height: 10px;
	margin: 4px auto 0;
	border-radius: 50%;
	background-color: $backgroundBlue;
	visibility: hidden;
}

:checked + .ui-radio::before {
	visibility: visible;
	-webkit-animation: bounceIn .2s;
	animation: bounceIn .2s;
}

:disabled + .ui-radio,
.ui-radio.disabled {
	/* 与设计师沟通，这里边框色值提高，否则不怎么好的显示器和背景色混在一起都看不出来 */
	border-color: $borderHover;
	opacity: .38;
}

/* error */
.error.ui-radio {
	border-color: $red;
}

/*IE7, IE8 使用图片作UI*/
@media \0screen\,screen\9 {
	.ui-radio {
		background: url(#{$urlImage}/Radio/radio.png) no-repeat;
	}
	.ui-radio:hover {
		background-position: 0 -20px;
	}
	[checked] + .ui-radio {
		background-position: 0 -40px;
	}
	[defaultChecked] + .ui-radio {
		background-position: 0 -40px;
	}
	[checked] + .ui-radio:hover,
	[checked][disabled] + .ui-radio {
		/* disabled态使用高亮边框 */
		background-position: 0 -60px;
	}
	[defaultChecked] + .ui-radio:hover,
	[defaultChecked][disabled] + .ui-radio {
		/* disabled态使用高亮边框 */
		background-position: 0 -60px;
	}
	[disabled] + .ui-radio {
		background-position: 0 -20px;
		filter: alpha(opacity=38);
	}
}
